//
//  CLRMSettingView.m
//  CLBrowser
//
//  Created by 梁慧聪 on 2022/7/27.
//

#import "CLRMSettingView.h"
#import "CLRMLightView.h"
#import "CLRMFontSizeView.h"
#import "CLRMEffectTypeView.h"
#import "CLRMFontTypeView.h"
#import "CLRMBGColorView.h"
#import "CLRMSpacingView.h"

@interface CLRMSettingView()
/// 亮度
@property (nonatomic, strong) CLRMLightView *lightView;

/// 字体大小
@property (nonatomic, strong) CLRMFontSizeView *fontSizeView;

/// 背景
@property (nonatomic, strong) CLRMBGColorView *bgColorView;

/// 翻页效果
@property (nonatomic, strong) CLRMEffectTypeView *effectTypeView;

/// 字体
@property (nonatomic, strong) CLRMFontTypeView *fontTypeView;

/// 间距
@property (nonatomic, strong) CLRMSpacingView *spacingView;

@end

@implementation CLRMSettingView


- (void)addSubviews {
    [super addSubviews];
    
    CGFloat x = CL_SPACE_SA_15;
    CGFloat w = CL_READ_CONTENT_VIEW_WIDTH - CL_SPACE_SA_30;
    CGFloat h = CL_READ_MENU_SETTING_SUB_VIEW_HEIGHT;
    
    CLRMLightView *lightView = [[CLRMLightView alloc]initWithReadMenu:self.readMenu];
    self.lightView = lightView;
    [self addSubview:lightView];
    lightView.frame = CGRectMake(x, 0, w, h);
    
    CLRMFontSizeView *fontSizeView = [[CLRMFontSizeView alloc]initWithReadMenu:self.readMenu];
    self.fontSizeView = fontSizeView;
    [self addSubview:fontSizeView];
    fontSizeView.frame = CGRectMake(x, CGRectGetMaxY(lightView.frame), w, h);
    
    CLRMEffectTypeView *effectTypeView = [[CLRMEffectTypeView alloc]initWithReadMenu:self.readMenu];
    self.effectTypeView = effectTypeView;
    [self addSubview:effectTypeView];
    effectTypeView.frame = CGRectMake(x, CGRectGetMaxY(fontSizeView.frame), w, h);
    
    CLRMFontTypeView *fontTypeView = [[CLRMFontTypeView alloc]initWithReadMenu:self.readMenu];
    self.fontTypeView = fontTypeView;
    [self addSubview:fontTypeView];
    fontTypeView.frame = CGRectMake(x, CGRectGetMaxY(effectTypeView.frame), w, h);
    
    CLRMBGColorView *bgColorView = [[CLRMBGColorView alloc]initWithReadMenu:self.readMenu];
    self.bgColorView = bgColorView;
    [self addSubview:bgColorView];
    bgColorView.frame = CGRectMake(x, CGRectGetMaxY(fontTypeView.frame), w, h);
    
    
    CLRMSpacingView *spacingView = [[CLRMSpacingView alloc]initWithReadMenu:self.readMenu];
    self.spacingView = spacingView;
    [self addSubview:spacingView];
    spacingView.frame = CGRectMake(x, CGRectGetMaxY(bgColorView.frame), w, h);

}

@end
